<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增语言能力')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-language-add" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" type="hidden" id="id" th:value="${id}"/>
        <h4 class="form-header h4">语言能力</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">语言类型：</label>
                    <div class="col-sm-8">
                        <select name="LanguageType" id="LanguageType" class="form-control m-b"
                                th:with="type=${@dict.getType('ECD_LANGUAGETYPE')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">熟练程度：</label>
                    <div class="col-sm-8">
                        <select name="LanguageGrade" id="LanguageGrade" class="form-control m-b"
                                th:with="type=${@dict.getType('ECD_LANGUAGEGRADE')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">获得证书：</label>
                    <div class="col-sm-8">
                        <input name="Certificate" id="Certificate" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">获得证书日期：</label>
                    <div class="col-sm-8">
                        <input name="effectDate" id="effectDate" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "entryManage/EntryBackground";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-language-add").serializeArray();

            var id = $("#id").val();
            var LanguageType = $("#LanguageType").val();
            var LanguageGrade = $("#LanguageGrade").val();
            var Certificate = $("#Certificate").val();
            var effectDate = $("#effectDate").val();
            var Remark = $("#Remark").val();

            data.push({"name": "id", "value": id});
            data.push({"name": "LanguageType", "value": LanguageType});
            data.push({"name": "LanguageGrade", "value": LanguageGrade});
            data.push({"name": "Certificate", "value": Certificate});
            data.push({"name": "effectDate", "value": effectDate});
            data.push({"name": "Remark", "value": Remark});

            $.operate.save(prefix + "/addLanguage", data);

        }
    }


</script>
</body>
</html>
